////////////////////////////////////////////////////////////////////////////////
// Filename: deferred.ps
////////////////////////////////////////////////////////////////////////////////


//////////////
// TEXTURES //
//////////////
Texture2D shaderTexture;
SamplerState SampleType;


//////////////
// TYPEDEFS //
//////////////
struct PixelInputType
{
    float4 position : SV_POSITION;
    float3 pos : POSITION;
    float2 tex : TEXCOORD0;
	float3 normal : NORMAL;
};

struct PixelOutputType
{
    float4 color : SV_Target0;
    float4 position : SV_Target1;
    float4 normal : SV_Target2;
};


////////////////////////////////////////////////////////////////////////////////
// Pixel Shader
////////////////////////////////////////////////////////////////////////////////
PixelOutputType psShader(PixelInputType input) 
{
	PixelOutputType output;

	// Sample the color from the texture and store it for output to the render target.
	output.color = shaderTexture.Sample(SampleType, input.tex);
	
	// Store the normal for output to the render target.
	output.normal = float4(input.normal, 1.0f);

	output.position = float4(input.pos, 1);
	
    return output;
}